#pragma once

#include "Event.h"
#include <sstream>

namespace Hazal
{
	/// <summary>
	/// 鼠标移动事件
	/// </summary>
	class HZ_DLL_OPTION CMouseMovedEvent : public CEvent
	{
		EVEMT_CLASS_CATEGORY(E_EVENT_CATEGORY::E_EVENT_CAT_INPUT | E_EVENT_CATEGORY::E_EVENT_CAT_MOUSE)

		EVENT_CLASS_TYPE(E_EVENT_MOUSE_MOVED)

	public:
		CMouseMovedEvent(float fX, float fY) :
			m_fMouseX(fX), m_fMouseY(fY) {}

	public:
		inline float GetX() const { return m_fMouseX; }
		inline float GetY() const { return m_fMouseY; }

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseMovedEvent: " << m_fMouseX << ", " << m_fMouseY;

			return ss.str();
		}

	private:
		float m_fMouseX;
		float m_fMouseY;
	};

	class HZ_DLL_OPTION CMouseScrolledEvent : public CEvent
	{
		EVEMT_CLASS_CATEGORY(E_EVENT_CATEGORY::E_EVENT_CAT_INPUT | E_EVENT_CATEGORY::E_EVENT_CAT_MOUSE)

		EVENT_CLASS_TYPE(E_EVENT_MOUSE_SCROLLED)

	public:
		CMouseScrolledEvent(float fOffSetX, float fOffsetY) :
			m_fOffsetX(fOffSetX), m_fOffsetY(fOffsetY) {}

	public:
		inline float GetXOffset() const { return m_fOffsetX; }
		inline float GetYOffset() const { return m_fOffsetY; }

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseScrolledEvent: " << m_fOffsetX << ", " << m_fOffsetY;

			return ss.str();
		}

	private:
		float m_fOffsetX;
		float m_fOffsetY;
	};

	class HZ_DLL_OPTION CMouseButtonEvent : public CEvent
	{
		EVEMT_CLASS_CATEGORY(E_EVENT_CATEGORY::E_EVENT_CAT_INPUT | E_EVENT_CATEGORY::E_EVENT_CAT_MOUSE_BUTTON)

	public:
		inline int GetMouseButton() const { return m_nButton; }

	protected:
		CMouseButtonEvent(int nButton) : m_nButton(nButton) {}

		int m_nButton;	///< Button Id
	};

	class HZ_DLL_OPTION CMouseButtonPressedEvent : public CMouseButtonEvent
	{
		EVENT_CLASS_TYPE(E_EVENT_MOUSE_BUTTON_PRESSED)

	public:
		CMouseButtonPressedEvent(int nButton) : 
			CMouseButtonEvent(nButton) {}

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseButtonPressedEvent: " << m_nButton;

			return ss.str();
		}
	};

	class HZ_DLL_OPTION CMouseButtonReleasedEvent : public CMouseButtonEvent
	{
		EVENT_CLASS_TYPE(E_EVENT_MOUSE_BUTTON_RELEASED)

	public:
		CMouseButtonReleasedEvent(int nButton) :
			CMouseButtonEvent(nButton) {}

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseButtonReleasedEvent: " << m_nButton;

			return ss.str();
		}
	};
}
